package com.bianguo.android.apushdemo.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.bianguo.android.apushdemo.entity.Images;
import com.bianguo.android.apushdemo.entity.MovieEntity;
import com.bianguo.android.apushdemo.entity.Rating;
import com.bianguo.android.apushdemo.entity.Subject;

import com.bianguo.android.apushdemo.dao.ImagesDao;
import com.bianguo.android.apushdemo.dao.MovieEntityDao;
import com.bianguo.android.apushdemo.dao.RatingDao;
import com.bianguo.android.apushdemo.dao.SubjectDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig imagesDaoConfig;
    private final DaoConfig movieEntityDaoConfig;
    private final DaoConfig ratingDaoConfig;
    private final DaoConfig subjectDaoConfig;

    private final ImagesDao imagesDao;
    private final MovieEntityDao movieEntityDao;
    private final RatingDao ratingDao;
    private final SubjectDao subjectDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        imagesDaoConfig = daoConfigMap.get(ImagesDao.class).clone();
        imagesDaoConfig.initIdentityScope(type);

        movieEntityDaoConfig = daoConfigMap.get(MovieEntityDao.class).clone();
        movieEntityDaoConfig.initIdentityScope(type);

        ratingDaoConfig = daoConfigMap.get(RatingDao.class).clone();
        ratingDaoConfig.initIdentityScope(type);

        subjectDaoConfig = daoConfigMap.get(SubjectDao.class).clone();
        subjectDaoConfig.initIdentityScope(type);

        imagesDao = new ImagesDao(imagesDaoConfig, this);
        movieEntityDao = new MovieEntityDao(movieEntityDaoConfig, this);
        ratingDao = new RatingDao(ratingDaoConfig, this);
        subjectDao = new SubjectDao(subjectDaoConfig, this);

        registerDao(Images.class, imagesDao);
        registerDao(MovieEntity.class, movieEntityDao);
        registerDao(Rating.class, ratingDao);
        registerDao(Subject.class, subjectDao);
    }
    
    public void clear() {
        imagesDaoConfig.getIdentityScope().clear();
        movieEntityDaoConfig.getIdentityScope().clear();
        ratingDaoConfig.getIdentityScope().clear();
        subjectDaoConfig.getIdentityScope().clear();
    }

    public ImagesDao getImagesDao() {
        return imagesDao;
    }

    public MovieEntityDao getMovieEntityDao() {
        return movieEntityDao;
    }

    public RatingDao getRatingDao() {
        return ratingDao;
    }

    public SubjectDao getSubjectDao() {
        return subjectDao;
    }

}
